<link href="https://cdn.bootcss.com/weui/1.1.2/style/weui.min.css" rel="stylesheet">
<script type="text/javascript" src="https://res.wx.qq.com/open/libs/weuijs/1.1.3/weui.min.js"></script>

<style>
    .weui-cells{
        font-size: 13px;
    }
    body{
        padding-bottom: 40px;
    }
</style>
<div id='app' class='page'>
   <!--  
    <div class="weui-cells__title">提货商品</div>
    <div class="weui-cells weui-cells_radio">
        <?php foreach($goodslist as $goods){ ?>
        <label class="weui-cell weui-check__label" for="s<?=$goods['goods_id']?>">
            <div class="weui-cell__bd">
                <img style="width:80px;display: inline-block;float:left;" src="<?=C('UPYUN_DOMAIN').$goods['goods_pic']?>"/>
                <p style="line-height: 80px;"><?=$goods['goods_name']?></p>
            </div>
            <div class="weui-cell__ft">
                <input type="radio" class="weui-check" id="s<?=$goods['goods_id']?>" value="<?=$goods['goods_id']?>" v-model='order.goods_id'>
                <span class="weui-icon-checked"></span>
            </div>
        </label>
        <?php } ?>
    </div> -->
     
    <div class="weui-cells__title">订单详情</div>
    <div class="weui-cells weui-cells_form">
        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">数量</label></div>
            <div class="weui-cell__bd">
                <input v-model='order.number' class="weui-input" type="number" placeholder="请输入数量(<?=C('TIHUO_NUM')?>的倍数)">
            </div>
        </div>
        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">姓名</label></div>
            <div class="weui-cell__bd">
                <input v-model='order.realname' class="weui-input" type="text" placeholder="请输入收货人姓名">
            </div>
        </div>
        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">手机</label></div>
            <div class="weui-cell__bd">
                <input v-model='order.mobile' class="weui-input" type="text" placeholder="请输入收货人手机">
            </div>
        </div>
        <div class="weui-cell weui-cell_select weui-cell_select-after">
            <div class="weui-cell__hd">
                <label class="weui-label"><span style="color:red">*</span>省</label>
            </div>
            <div class="weui-cell__bd">
                <select class="weui-select" v-model='order.province'  id="province" name="user_province">
                </select>
            </div>
        </div>
        <div class="weui-cell weui-cell_select weui-cell_select-after">
            <div class="weui-cell__hd">
                <label class="weui-label"><span style="color:red">*</span>市</label>
            </div>
            <div class="weui-cell__bd">
                <select class="weui-select" v-model='order.city'  id="city" name="user_city">
                </select>
            </div>
        </div>
        <div class="weui-cell weui-cell_select weui-cell_select-after">
            <div class="weui-cell__hd">
                <label class="weui-label"><span style="color:red">*</span>区</label>
            </div>
            <div class="weui-cell__bd">
                <select class="weui-select" v-model='order.county'  id="county" name="user_county">
                </select>
            </div>
        </div>
        <div class="weui-cell">
            <div class="weui-cell__bd">
                <textarea class="weui-textarea" v-model='order.address' placeholder="请输入详细地址" rows="3"></textarea>
                <div class="weui-textarea-counter"></div>
            </div>
        </div>
<!--        <div class="weui-cell weui-cell_vcode">
            <div class="weui-cell__hd">
                <label class="weui-label">手机号</label>
            </div>
            <div class="weui-cell__bd">
                <input disabled value="<?=$memberinfo['mobile']?>" class="weui-input" type="tel" placeholder="请输入手机号">
            </div>
            <div class="weui-cell__ft">
                <button @click='getsmscode' id="smscode" class="weui-vcode-btn">{{smstext}}</button>
            </div>
        </div>
        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">验证码</label></div>
            <div class="weui-cell__bd">
                <input v-model='order.smscode' class="weui-input" type="number" placeholder="请输入验证码">
            </div>
        </div>-->
    </div>
   
    <div class="weui-cells">
        <div class="weui-cell">
            <div class="weui-cell__bd">
                <p>可提货库存</p>
            </div>
            <div class="weui-cell__ft"><?=$memberinfo['stock']?></div>
        </div>
    </div>
    <div style='padding:20px 15px;'>
        <a @click='addOrder'  class="weui-btn weui-btn_primary">提交</a>
    </div>
</div>

<div style="width:100%;white-space:normal;padding:20px 15px;box-sizing: border-box;">
    <p>
    温馨提示
</p>
<ol class="ol1 list-paddingleft-2" style=" font-family: sans-serif; white-space: normal;">
    <li>
        <p>
            1、请您准确填写提货信息，以免造成无法接收
        </p>
    </li>
    <li>
        <p>
            2、由于发货数量庞大，发货顺序按照下单时间安排（国家法定节日除外）
        </p>
    </li>
    <li>
        <p>
            3、提货成功查看物流信息可在会员中心已发货订单查看（物流跟踪）
        </p>
    </li>
</ol>
</div>
<include file="Common:nav" />
<script src="https://cdn.bootcss.com/vue/2.4.4/vue.min.js"></script>
<script src="__STATIC__mobile/js/areadata.js"></script>
<script src="__STATIC__mobile/js/myarea.js"></script>
<script>
    var app = new Vue({
        el: '#app',
        data: {
            order: {
                order_type: '',
                realname:'',
                mobile:'',
                idcard:'',
                refer_uid:'',
                number:'',
                province:'',
                city:'',
                county:'',
                address:'',
                smscode:'',
                goods_id:1
            },
            smstext:'获取验证码'
        },
        mounted: function () {
            city.getcity('province','city','county','<?php echo $delivery["province"];?>','<?php echo $delivery["city"];?>','<?php echo $delivery["county"];?>',1);
        },
        methods: {
            addOrder: function () {
                var self = this;
                var cfm = weui.confirm('确定提交订单吗?',function(){
                    var loading = weui.loading('loading');
                    $.ajax({
                        url:'/mobile/orderadd/tihuo',
                        data: self.order,
                        type:'post'
                    }).then(function(res){
                        loading.hide();
                        if(res.ret==1) {
                            showerror(res.msg);
                        }else if(res.ret==0){
                            showsuccess(res.msg,res.url);
                        }
                    });
                })
            },
            getsmscode: function () {
                AjaxUrl('/mobile/user/getsmscode');
                this.smstext = '已发送';
            }
        }
    });
</script>